sduimgr module

class sd.api.sduimgr.SDUIMgr(APIContext, handle, *args, **kwargs)

Bases: sd.api.sdapiobject.SDAPIObject

addActionToExplorerToolbar(explorerID: int, actionPtr: int) → None

Add an action to an explorer toolbar

Parameters
  • explorerID – Explorer identifier

  • actionPtr – Pointer to an action

addToolbarToGraphView(graphViewID: int, toolbarWidgetPtr: int, toggleActionPtr: int) → None

Add a toolbar to a graph view

Parameters
  • graphViewID – Graph view identifier

  • toolbarWidgetPtr – Pointer to the toolbar

  • toggleActionPtr – Pointer to the toolbar toggle view action

static convertSDTextureToQImage(sdTexture: sd.api.sdtexture.SDTexture, qimagePtr: int) → None

Convert a SDTexture into a QImage

Parameters
  • sdTexture – The texture that will be converted

  • qimagePtr – Shiboken pointer to the destination image

deleteMenu(objectName: str) → None

Remove a menu from the application menu bar

Parameters

objectName – The internal object name of the menu

findMenuFromObjectName(objectName: str) → Optional[int]

Return a pointer to a currently existing menu in the application menu bar

Parameters

objectName – The internal object name of the menu

getClassName() → str

Returns the most specific name of the class this APIObject is

getCurrentGraph() → Optional[sd.api.sdgraph.SDGraph]

Get the current graph (can be None)

getCurrentGraphSelectedNodes() → Optional[sd.api.sdarray.SDArray[sd.api.sdnode.SDNode][sd.api.sdnode.SDNode]]

Get the selected nodes in the current graph

getCurrentGraphSelectedObjects() → Optional[sd.api.sdarray.SDArray[sd.api.sdgraphobject.SDGraphObject][sd.api.sdgraphobject.SDGraphObject]]

Get the selected graph objects in the current graph

getCurrentGraphSelection(**kwargs)
getCurrentGraphSelectionFromGraphViewID(**kwargs)
getExplorerSelection(explorerID: int) → Optional[sd.api.sdarray.SDArray[sd.api.sdapiobject.SDAPIObject][sd.api.sdapiobject.SDAPIObject]]

Return the currently selected items in the explorer panel

Parameters

explorerID – Explorer identifier

getGraphFromGraphViewID(graphViewID: int) → Optional[sd.api.sdgraph.SDGraph]

Get the graph from a Graph View ID (can be None)

Parameters

graphViewID – The Graph View ID

getGraphSelectedNodesFromGraphViewID(graphViewID: int) → Optional[sd.api.sdarray.SDArray[sd.api.sdnode.SDNode][sd.api.sdnode.SDNode]]

Get the selected nodes in a graph from a Graph View ID (can be None)

Parameters

graphViewID – The Graph View ID

getGraphSelectedObjectsFromGraphViewID(graphViewID: int) → Optional[sd.api.sdarray.SDArray[sd.api.sdgraphobject.SDGraphObject][sd.api.sdgraphobject.SDGraphObject]]

Get the selected graph objects in the current graph

Parameters

graphViewID – The Graph View ID

getMainWindowPtr() → Optional[int]

Get the main window pointer

newDockWidget(identifier: str, title: str) → int

Create a new dock widget

Parameters
  • identifier – Dock internal identifier (must be unique)

  • title – Dock title

newMenu(menuTitle: str, objectName: str) → int

Create a new menu in the application menu bar

Parameters
  • menuTitle – The menu title

  • objectName – The internal object name of the menu

registerExplorerCreatedCallback(callable)

Register a callback to be called when a new explorer is created Returns a callback ID that can be used later to unregister the callback

Parameters

callable (Python function) – Function to call when a new explorer is created

Return type

int

registerExplorerSelectionChangedCallback(callable)

Register a callback to be called when the explorer selection changed Returns a callback ID that can be used later to unregister the callback

Parameters

callable (Python function) – Function to call when the explorer selection changed

Return type

int

registerGraphViewCreatedCallback(callable)

Register a callback to be called when a new graph view is created Returns a callback ID that can be used later to unregister the callback

Parameters

callable (Python function) – Function to call when a new graph view is created

Return type

int

release() → None

Releases an APIObject

unregisterCallback(callbackID)

Unregister a callback

Parameters

callbackID (int) – The callback ID of the callback to unregister

Return type

None